home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / readers / utils / posterprint / source.amos / source.amosSourceCode
AMOS Source Code  |  1996-11-09  |  3KB  |  119 lines

  1. Default 
  2. Dim W$(11)
  3. PAP=6 : PN=2 : IK1=2 : IK2=8 : FLG=0
  4. IX=2 : TX=28 : NL=0 : PGLEN=56 : PGWID=80
  5. NL=1 : PHT=2 : PWD=1 : MXPHT=9 : CH$="@"
  6. Screen Open 0,640,256,16,Hires
  7. Pen PN : Paper PAP : Hide 
  8.    _SCREEN:
  9. Home : Curs Off : Cls PAP : Cline 
  10. Ink IK2 : Box 0,0 To 639,24
  11. Ink IK1 : Box 1,1 To 638,23
  12. Ink IK2 : Box 0,26 To 639,141
  13. Ink IK1 : Box 1,27 To 638,140
  14. Ink IK2 : Box 0,143 To 639,255
  15. Ink IK1 : Box 1,144 To 638,254
  16. Locate ,1 : Centre "POSTER PRINT v2 - S. Ashmole "
  17. Gosub DISPLAY
  18.    MAIN:
  19. Gosub DISPLAY
  20. Do 
  21. If Key State(80) Then Gosub _SET_TEXT : Gosub _CALC : Goto MAIN
  22. If Key State(81) Then Gosub _SET_P_HT : Gosub _CALC : Goto MAIN
  23. If Key State(82) Then Gosub _SET_P_W : Gosub _CALC : Goto MAIN
  24. If Key State(83) Then Gosub _PAGE_LENGTH : Goto MAIN
  25. If Key State(84) Then Gosub _PAGE_WIDTH : Gosub _CALC : Goto MAIN
  26. If Key State(85) Then Gosub _CALC : Gosub _PRINT : Goto _SCREEN
  27. Loop 
  28.    _CALC:
  29. MXPHT=(PGWID/(NL*8))-1
  30. TAB=(PGWID-((PHT*8)*NL))/2
  31. OW$=W$(1) : W$=OW$ : LS=Len(W$)
  32. For N=1 To NL
  33. If Len(W$(N))>Len(OW$) Then W$=W$(N) : LS=Len(W$)
  34. L=(LS*8)-1
  35. Next N
  36. NC=(PWD*8)*LS : VTAB=((PGLEN-NC)/2)
  37. If VTAB<0 Then VTAB=0
  38. Return 
  39.    _PRINT:
  40. If FLG=0 or PHT=0 or PWD=0 Then Lprint Chr$(7); : Locate ,IY : Centre "PARAMETER(S) NOT SET!" : Wait 50 : Return 
  41. Cls PAP : Home 
  42. For N=1 To NL
  43. Print W$(N)
  44. Next N
  45. Lprint Chr$(27);"@"
  46. Do : If Inkey$="" Then Exit : Loop 
  47. Locate ,14 : Centre "SET PRINTER NOW! (then press a key)" : Wait Key : Cline : Centre "PRINTING..."
  48. For N=1 To VTAB : Lprint : Next N
  49. For X=0 To L
  50. For N=1 To PWD
  51. For I=1 To TAB : Lprint " "; : Next I
  52. For Y=(NL*8)-1 To 0 Step -1
  53. If Point(X,Y)=PN Then PR$=CH$ : Else PR$=" "
  54. For M=1 To PHT
  55. Lprint PR$;
  56. Next M
  57. Next Y
  58. Lprint 
  59. Next N
  60. Next X
  61. Lprint Chr$(12)
  62. Return 
  63.    _SET_TEXT:
  64. Locate IX,IY
  65. POSW=PGWID/(PHT*8)
  66. Print "Enter up to";POSW;" lines:-" : Print 
  67. NL=1 : IY=IY+2
  68. Do 
  69. W$(NL)=""
  70. Locate IX,IY
  71. Print "Line";NL;" - "; : Input "Enter text:  ";W$(NL)
  72. If W$(NL)="" Then Exit 
  73. IY=IY+1 : NL=NL+1 : If NL>POSW Then Locate IX,IY : Print "Done!" : Wait Key : Exit 
  74. Loop 
  75. NL=NL-1 : If NL<1 Then NL=1
  76. FLG=1
  77. Return 
  78.    _SET_P_HT:
  79. OPHT=PHT
  80. Locate IX,IY
  81. Print "Max. print height: ";MXPHT
  82. Locate IX+36,IY+2 : Print "          "
  83. Locate IX,IY+2
  84. Input "Enter print height in chars/pixel:  ";PHT
  85. If PHT>MXPHT Then Locate IX, : Print "Print height error! - try again" : PHT=OPHT : Wait 50 : Goto _SET_P_HT
  86. If PHT=0 Then PHT=OPHT
  87. Return 
  88.    _SET_P_W:
  89. OPWD=PWD
  90. Locate IX,IY
  91. Input "Enter print width in chars/pixel:  ";PWD
  92. If PWD=0 Then PWD=OPWD
  93. Return 
  94.     _PAGE_LENGTH:
  95. OPGLEN=PGLEN
  96. Locate IX,IY
  97. Input "Enter page length:  ";PGLEN
  98. If PGLEN=0 Then PGLEN=OPGLEN
  99. Return 
  100.    _PAGE_WIDTH:
  101. OPGWID=PGWID
  102. Locate IX+18,IY : Print "          "
  103. Locate IX,IY
  104. Input "Enter page width:  ";PGWID
  105. If PGWID=0 Then PGWID=OPGWID : Return 
  106. If PGWID/((PHT*8)*NL)<1 Then Locate IX, : Print "Page width error! - try again" : PGWID=OPGWID : Wait 50 : Goto _PAGE_WIDTH
  107. Return 
  108.      DISPLAY:
  109. Curs Off 
  110. Cls PAP,2,145 To 637,253
  111. IY=19
  112. Locate TX,6 : Print "F1 - Set text";"  "
  113. Locate TX,7 : Print "F2 - Print height    ";PHT;"  "
  114. Locate TX,8 : Print "F3 - Print width     ";PWD;"  "
  115. Locate TX,9 : Print "F4 - Page length     ";PGLEN;"  "
  116. Locate TX,10 : Print "F5 - Page width      ";PGWID;"  "
  117. Locate TX,11 : Print "F6 - Go!"
  118. Locate TX,14 : Print "Total print length   ";NC;"  "
  119. Return